package com.ruoyi.caigou.api;

import com.ruoyi.caigou.api.factory.RemoteBuyOrderFallbackFactory;
import com.ruoyi.caigou.domain.BuyOrder;
import com.ruoyi.common.core.constant.SecurityConstants;
import com.ruoyi.common.core.constant.ServiceNameConstants;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.core.web.domain.AjaxResult;
import com.ruoyi.system.api.domain.caigou.BuyBackReq;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

/**
 * author:lvql
 * time:
 */
@FeignClient(contextId = "remoteBuyOrderService", value = ServiceNameConstants.CAIGOU_SERVICE,fallbackFactory = RemoteBuyOrderFallbackFactory.class)
public interface RemoteBuyOrderService {


    @GetMapping("/buyOrder/getByCode/{code}")
    public R<BuyOrder> getInfoByCode(@PathVariable("code") String code, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);

    @PutMapping("/buyOrder/innerEdit")
    public R<Boolean> innerEdit(@RequestBody BuyOrder buyOrder, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);

    @PutMapping("/buyOrder/innerEditByCode")
    public R<Boolean> innerEditByCode(@RequestBody BuyOrder buyOrder, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);

}
